home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 15 / CU Amiga Magazine's Super CD-ROM 15 (1997)(EMAP Images)(GB)[!][issue 1997-10].iso / CUCD / Graphics / Ghostscript / source / gxdither.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  3.3 KB  |  79 lines

  1. /* Copyright (C) 1994, 1995, 1996, 1997 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of Aladdin Ghostscript.
  4.   
  5.   Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  9.   License (the "License") for full details.
  10.   
  11.   Every copy of Aladdin Ghostscript must include a copy of the License,
  12.   normally in a plain ASCII text file named PUBLIC.  The License grants you
  13.   the right to copy, modify and redistribute Aladdin Ghostscript, but only
  14.   under certain conditions described in the License.  Among other things, the
  15.   License requires that the copyright notice and this notice be preserved on
  16.   all copies.
  17. */
  18.  
  19. /* gxdither.h */
  20. /* Interface to gxdither.c */
  21.  
  22. #ifndef gx_device_halftone_DEFINED
  23. #  define gx_device_halftone_DEFINED
  24. typedef struct gx_device_halftone_s gx_device_halftone;
  25. #endif
  26.  
  27. #ifdef DPNEXT
  28. /*
  29.  * Note that in the procedures below, the colors are specified by fracs,
  30.  * but the alpha value is a gx_color_value.  This is a design flaw that
  31.  * we might be able to fix eventually.
  32.  */
  33. #endif
  34.  
  35. /* Render a gray, possibly by halftoning. */
  36. /* Return 0 if complete, 1 if caller must do gx_color_load, <0 on error. */
  37. int gx_render_device_gray(P6(frac gray, gx_color_value alpha,
  38.                  gx_device_color *pdevc, gx_device *dev,
  39.                  const gx_device_halftone *dev_ht,
  40.                  const gs_int_point *ht_phase));
  41. #ifdef DPNEXT
  42. #define gx_render_gray_alpha(gray, alpha, pdevc, pis, dev, select)\
  43.   gx_render_device_gray(gray, alpha, pdevc, dev, pis->dev_ht,\
  44.             &pis->screen_phase[select])
  45. #define gx_render_gray(gray, pdevc, pis, dev, select)\
  46.   gx_render_gray_alpha(gray, pis->alpha, pdevc, pis, dev, select)
  47. #else
  48. #define gx_render_gray(gray, pdevc, pis, dev, select)\
  49.   gx_render_device_gray(gray, pis->alpha, pdevc, dev, pis->dev_ht,\
  50.             &pis->screen_phase[select])
  51. #endif
  52.  
  53. /* Render a color, possibly by halftoning. */
  54. /* Return as for gx_render_[device_]gray. */
  55. int gx_render_device_color(P10(frac red, frac green, frac blue, frac white,
  56.                    bool cmyk, gx_color_value alpha,
  57.                    gx_device_color *pdevc, gx_device *dev,
  58.                    const gx_device_halftone *pdht,
  59.                    const gs_int_point *ht_phase));
  60. #ifdef DPNEXT
  61. #define gx_render_color_alpha(r, g, b, w, a, cmyk, pdevc, pis, dev, select)\
  62.   gx_render_device_color(r, g, b, w, cmyk, a, pdevc, dev,\
  63.              pis->dev_ht, &pis->screen_phase[select])
  64. #define gx_render_color(r, g, b, w, cmyk, pdevc, pis, dev, select)\
  65.   gx_render_color_alpha(r, g, b, w, pis->alpha, cmyk, pdevc, pis, dev, select)
  66. #else
  67. #define gx_render_color(r, g, b, w, cmyk, pdevc, pis, dev, select)\
  68.   gx_render_device_color(r, g, b, w, cmyk, pis->alpha, pdevc, dev,\
  69.              pis->dev_ht, &pis->screen_phase[select])
  70. #endif
  71. #define gx_render_rgb(r, g, b, pdevc, pis, dev, select)\
  72.   gx_render_color(r, g, b, frac_0, false, pdevc, pis, dev, select)
  73. #define gx_render_cmyk(c, m, y, k, pdevc, pis, dev, select)\
  74.   gx_render_color(c, m, y, k, true, pdevc, pis, dev, select)
  75. #ifdef DPNEXT
  76. #define gx_render_rgb_alpha(r, g, b, a, pdevc, pis, dev, select)\
  77.   gx_render_color_alpha(r, g, b, frac_0, a, false, pdevc, pis, dev, select)
  78. #endif
  79.